package com.apache;

import com.apache.ius.plugin.InitCacheDataUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * 服务启动完成后，执行其他处理！
 * 通过实现ApplicationRunner接口，在spring boot项目启动后打印参数
 */
@Component
public class ApplicationRunnerImpl implements ApplicationRunner {
    @Autowired
    private Environment env;
    private Logger log = Logger.getLogger(getClass());
    @Override
    public void run(ApplicationArguments args) throws Exception {
        InitCacheDataUtil.getInstance().initDataToCacheOther("","");
        log.info("服务["+env.getProperty("spring.application.name")+"]["+env.getProperty("server.port")+"]启动完成！！");
    }
}
